[GSoC 2026] Add automated translation stub generation for missing reference pages#1473
Draft
aashishpanthi wants to merge 17 commits into
Draft
Conversation
…in a nice expandable way
…README documentation
…generation limits per language; remove test files.
Divyansh013
reviewed
Jul 1, 2026
Divyansh013
left a comment
Member
There was a problem hiding this comment.
Hi @aashishpanthi , have added some comments
| */ | ||
| function generateStubFromEnglish(englishPath, language, contentType = 'reference') { | ||
| const raw = fs.readFileSync(englishPath, 'utf8'); | ||
| const frontmatter = parseFrontmatter(raw, englishPath); |
Member
There was a problem hiding this comment.
generateStubFromEnglish assumes MDX frontmatter, but the scanners also pick up .yaml files. When STUB_CONTENT_TYPES grows beyond reference this will throw and abort the whole batch (no per-file try/catch in the items.map). Either skip .yaml sources for stubbing or handle them explicitly, and wrap the per-file generation so one failure doesn't kill the run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1404
Changes
This PR implements stub-file generation for the GSoC 2026 Translation Tracker (#1404). When a new English reference page exists without translations, the tracker generates placeholder MDX stubs and opens one PR per language for maintainer review.
Features
Stub generation
findMissingTranslations)title,module,submodule,file,description)needsTranslation: truees,hi,ko,zh-HansSTUB_MAX_FILESapplies per language (default50), not as a global cap across all languagesGitHub Actions
.github/workflows/translation-stubs.ymlGENERATE_STUBS=true), separate from issue tracking intranslation-sync.ymlsrc/content/reference/en/**changesworkflow_dispatchwithfull_scanandlanguagesinputsLocal testing
npm run test:stubs— dry-run stub generation intostub-preview/(no PRs, nosrc/content/changes)Code organization
After discussing with Divyansh, I refactored the translation tracker from a single large
index.jsinto focused modules:index.jsconstants.jsutils.jsgithub-tracker.jsworkflows.jsDesign decisions
GENERATE_STUBS=truereturns before issue logic), so PR and issue workflows stay independent.examples,tutorials, etc. can be added later viaSTUB_CONTENT_TYPES.Test plan
aashishpanthi/p5.js-website): workflow creates stub PRs when English reference files are added/changedPR Checklist
To:Do
main. I added feature branch for testing.